Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devp2p DPT Type Improvements #1029

Merged
merged 8 commits into from
Jan 5, 2021
Merged

Conversation

holgerd77
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Jan 3, 2021

Codecov Report

Merging #1029 (9cc2ec7) into master (9937927) will decrease coverage by 0.05%.
The diff coverage is 72.22%.

Impacted file tree graph

Flag Coverage Δ
block 77.92% <ø> (ø)
blockchain 77.92% <ø> (ø)
client 87.31% <60.00%> (-0.05%) ⬇️
common 91.87% <ø> (ø)
devp2p 82.61% <76.92%> (-0.10%) ⬇️
ethash 82.08% <ø> (ø)
tx 86.25% <ø> (ø)
vm 83.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

…ng in client (fixes wrongly propagated timeout error on bootnodes)
@holgerd77
Copy link
Member Author

Ok, open for review, commit messages should be relatively self-descriptive. 😄

if (Buffer.isBuffer(obj)) return [obj.toString('hex')]
if (typeof obj === 'string') return [obj]

const keys = []
if (Buffer.isBuffer(obj.id)) keys.push(obj.id.toString('hex'))
if (obj.address && obj.port) keys.push(`${obj.address}:${obj.port}`)
//if (obj.address && obj.port) keys.push(`${obj.address}:${obj.port}`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this remain commented out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is just no property port on peer objects - just updPort and tcpPort, so the line in its current form has no effect and I couldn't decide on selecting for one of the other port properties, in fact I am not understanding well enough what this line is doing TBH. So I left to indicate that there was something which might have had some intention. 😄 Could have left a comment though.

Will also leave to not revoke the approval but rather merge here now.

try {
await Promise.all(promises)
} catch (e) {
this.error(e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codecov is warning that this line isn't covered, it's not so important, but could add a quick test forcing a fast timeout to ensure the error is caught and propagated properly

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will leave this for now but generally that's a good idea - also left a comment on the codecov/patch discussion in the chat. Will likely be good if we get to some work mode where we take coverage more serious again (I at least started in #1028 to add some substantial tests and had a look at codecov/patch, took me quite some time but I think I finally had some mental breakthrough in my testdouble understanding 😄 ).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've directly taken the occasion and made the codecov/project check mandatory again, together with the other library's test-* checks (e.g. test-trie), think we still had some gap here due to uncertainties in the CI setup for some time (these "run everything or run selected" discussions). And we can of course later always adopt again if some CI setup change comes up.

Copy link
Contributor

@ryanio ryanio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left two quick comments but otherwise looks great! much better clarity with the improved types :)

@holgerd77 holgerd77 merged commit 86fb51d into master Jan 5, 2021
@holgerd77 holgerd77 deleted the devp2p-dpt-type-improvements branch January 5, 2021 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants